import { ClinicScheduleApi } from '@/api/clinic-schedule';
import { useRequest } from '@/hooks/useRequest';
import { currRoute } from '@/utils/router.utils';

export function useDoctorInfo() {
  const { query } = currRoute();

  // 获取医生信息
  const { data: doctor } = useRequest(() => ClinicScheduleApi.getDoctorList({
    doctorId: query.doctorId as unknown as number
  }).then(res => res[0]));

  return {
    doctor
  };
}
